
import SwiftUI
struct DemoContentView: View {
    @State private var path = NavigationPath()
    
    var body: some View {
        NavigationStack(path: $path) {
            Button("跳转到三级页面") {
                path.append(1) // 第一级
                path.append("二级")
                path.append(3.0) // 第三级
            }
            .navigationDestination(for: Int.self) { _ in
                Text("整数页面")
            }
            .navigationDestination(for: String.self) { _ in
                Text("字符串页面")
            }
            .navigationDestination(for: Double.self) { _ in
                Text("浮点数页面")
            }
        }
    }
}



#Preview{
    DemoContentView()
}
